package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.Tag;
import java.lang.Long;
import java.util.List;

privileged aspect Tag_Roo_Entity {
    
    public static long Tag.countTags() {
        return (Long) entityManager().createQuery("select count(o) from Tag o").getSingleResult();
    }
    
    public static List<Tag> Tag.findAllTags() {
        return entityManager().createQuery("select o from Tag o").getResultList();
    }
    
    public static Tag Tag.findTag(Long id) {
        if (id == null) return null;
        return entityManager().find(Tag.class, id);
    }
    
    public static List<Tag> Tag.findTagEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from Tag o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
